package feizhou.untils.tools;

import org.apache.log4j.Logger;

import java.io.InputStream;
import java.util.Properties;

public class DispatcherUtil extends Properties {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5071100798886187639L;
	
	private static Logger logger = Logger.getLogger(DispatcherUtil.class);
	private static DispatcherUtil disUtil;

	public static DispatcherUtil getInstance() {
		if (null == disUtil) {
			synchronized (DispatcherUtil.class) {
				if (null == disUtil) {
					disUtil = new DispatcherUtil();
					try {
						InputStream is = Thread
								.currentThread()
								.getContextClassLoader()
								.getResourceAsStream(
										"format_dispatcher.properties");
						disUtil.load(is);
					} catch (Exception e) {
						logger.error(e.getMessage(), e);
					}
				}
			}
		}
		return disUtil;
	}
}
